from fastapi import APIRouter, Depends, HTTPException
from typing import Dict, Any

from app.models.schemas import ProcessingRequest
from app.services.content_service import generate_content_strategy
from app.clients.volcano_client import get_volcano_client
from app.clients.feishu_client import get_feishu_client

router = APIRouter()


@router.post("/video-demo-create", response_model=Dict[str, Any])
async def generate_content(
    request: ProcessingRequest,
    volcano_client = Depends(get_volcano_client),
    feishu_client = Depends(get_feishu_client)
):
    """生成内容策略主接口"""
    try:
        result = await generate_content_strategy(
            request,
            volcano_client,
            feishu_client
        )
        return {
            "success": True,
            "data": result
        }
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))
